﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.Library;
using IHISCETeim.BLL;

namespace IHISCETeim.Web.MachineSys.SysBasic
{
    public partial class OUser_RestPwd : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "resetpwd")
            {
                addmenu();
            }
        }

        protected void addmenu()
        {
          
            string newPassword = GetRequestValue<string>("newPassword");
            
            newPassword = StringHelper.GetPwdEncrypt(newPassword);
           
            if (OUserController.EditPwd(UserId, newPassword))
                SuccessJson("已成功修改密码");
            else
                ErrorJson("修改失败");
        }

        protected int UserId
        {
            get { return GetRequestValue<int>("userid"); }
        }

        protected override string DWZRef
        {
            get { return ""; }
        }
    }
}